
if (open(FILE, "colors.txt")) {
@file = <FILE>;
open(OUT_FILE, ">colors_out.text");
foreach $line (@file) {
	if ($line ne "") {
		#$line =~ /(^\w+)(\d+)\,(\d+)\,(\d+)\)/;
		$line =~ /(\w+)rgb\(\s*(\d+),\s(\d+),\s(\d+)/;
		$color = $1;
		$red = $2;
		$green = $3;
		$blue = $4;
		printf ("<color name=\"%s\">\#%02X%02X%02X</color>\n", $color, $red, $green, $blue);
		printf OUT_FILE ("ListElement { color: \"$color\" }\n");
	}
}
close(FILE);
}